<?php
$front = Zend_Controller_Front::getInstance();
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
?>

<style>
    #logo{
        width: 30%;
        height: auto;
        position: absolute; 
        left: 700px;
        top: -200px;
    }
    
/*    #map {
        width: 500px;
        height: 400px;
        position: absolute;
        left: 650px;
        top: 95px;
    }*/
</style>

<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<!--<script type="text/javascript" src="<?= $front->getBaseUrl() . '/js/mapIndex.js' ?>"></script>-->
<script type="text/javascript">
    $(function(){
        var myLatlng = new google.maps.LatLng(<?= $user->latitude ?>,<?= $user->longitude ?>);
        var myOptions = {
          zoom: 15,
          center: myLatlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        var map = new google.maps.Map(document.getElementById("map"), myOptions);

        var marker = new google.maps.Marker({
            position: myLatlng,
            title:"<?= $user->username ?>"
        });

        // To add the marker to the map, call setMap();
        marker.setMap(map);
        
    });
</script>

<div class="hero-unit" style="height: 480px;">
    <h1>Personal Task</h1>
    <h2>Bienvenido <?= $user->username ?>!</h2>
    <img id="logo" src="<?= $front->getBaseUrl() . '/images/logo.png' ?>"/>
    <p>Planea tus actividades y mide tu rendimiento.</p>
    <p>
        <a class="btn btn-primary btn-large" href="<?= $this->url(array("controller" => "Activity", "action" => "save")) ?>">
            Crear Actividad
        </a>
    </p>
    <div class="span2">
        <a href="<?= $user->photo_url ?>" class="thumbnail">
            <img src="<?= $user->photo_url ?>" alt="">
        </a>
    </div>
    <div class="span8">
        <h3>Nombre de Usuario: <?= $user->username ?>!</h3>
        <h3>Edad: <?= $user->age ?></h3>
    </div>
    <div class="span4">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>Pendientes</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($this->taskPendientes as $task) :?>
                <tr>
                    <td><a href="<?= $this->url(array("controller" => "Activity", "action" => "monitor", "id" => $task["id"])) ?>"><?=$task["nombre"]?></a></td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
    <div class="span4">
        <div id="map" class="" style="width: 360px; height: 268px"></div>
    </div>
</div>